<%-- BeginRegion Page settings and assemblies registration --%>
<%@ Page Language="C#" Theme="Default"  AutoEventWireup="true" CodeFile="Schedule.aspx.cs" Inherits="Touchmax_Schedule" %>
<%@ Register Assembly="DevExpress.Web.ASPxScheduler.v9.2" Namespace="DevExpress.Web.ASPxScheduler"
    TagPrefix="dxwschs" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2" Namespace="DevExpress.Web.ASPxEditors"
    TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v9.2" Namespace="DevExpress.Web.ASPxGlobalEvents"
    TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxScheduler.v9.2, Version=9.2.6.0" Namespace="DevExpress.Web.ASPxScheduler" TagPrefix="dxwschs" %>
<%@ Register Assembly="DevExpress.XtraScheduler.v9.2.Core, Version=9.2.6.0" Namespace="DevExpress.XtraScheduler" TagPrefix="cc1" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0" Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dxp" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0" Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dxed" %>
<%@ Register Src="~/ColorworksDataSources.ascx" TagName="ColorworksDataSources" TagPrefix="dds" %>
<%-- EndRegion --%>
<html>
<head id="Head1" runat="server">
<title></title>
    <script type="text/javascript" src="/jquery.min.js"></script>
    <script type="text/javascript">
        var _load = false;
        var _resize = false;

        $(document).ready(function () {

            var h = $(window).height();
            var w = $(window).width();
            //$("#userbar").css('height', h - 72);
            //$("#framebar").css('height', h - 73);
            //$("#appbar").css('width', w - 208);

            //$(window).resize(function () {
            //    var h = $(window).height();
            //    var w = $(window).width();
            //    $("#userbar").css('height', h - 72);
            //    $("#framebar").css('height', h - 73);
            //    $("#appbar").css('width', w - 208);
            //});


        });
    </script>
    <script type="text/javascript">
var globalMouseX = 0;
var globalMouseY = 0;
var detectedMouseUp = false;
var detectedSelectionChanged = false
ASPxClientUtils.AttachEventToElement(document, "mousemove", createEventHandler("OnMouseMove"));
ASPxClientUtils.AttachEventToElement(document, "mouseup", createEventHandler("OnMouseUp"));        
function OnMouseMove(evt) {
    globalMouseX = ASPxClientUtils.GetEventX(evt);
    globalMouseY = ASPxClientUtils.GetEventY(evt);
    detectedSelectionChanged = false;
    detectedMouseUp = false;
}
function OnMouseUp(evt) {
    detectedMouseUp = true;
    ShowToolTip();
}
function createEventHandler(funcName) {
    return new Function("event", funcName + "(event);");
}
function OnSelectionChanged(s,e) {
    if (!scheduler.isAllowEvent) 
        return;
    detectedSelectionChanged = true;
    ShowToolTip();
}
function ShowToolTip() {
    if (detectedSelectionChanged && detectedMouseUp){
        scheduler.ShowSelectionToolTip(globalMouseX, globalMouseY);
        detectedSelectionChanged = false;
        detectedMouseUp = false;
    }
}
function OnBeginCallback() {
    delete scheduler.isAllowEvent;
}
function OnEndCallback() {
    scheduler.isAllowEvent = true;
}
function OnControlInitialized() {
    scheduler.isAllowEvent = true;
}
    </script>

    </head>
<body style="margin:0px;padding:0px;">
    <form runat="server" id="form1">
	<%-- BeginRegion DataSources --%>
	<dds:ColorworksDataSources runat="server" ID="schedulerDataSource" />
    
     <table width="100%" height="100%">
    <tr>
    <td width="*" valign="top">
    <dxwschs:ASPxScheduler id="ASPxScheduler1" GroupType="Resource" ResourceNavigator-Visibility ="Never" runat="server" Width="100%" Start="2008-08-27" ClientInstanceName="scheduler" OnBeforeExecuteCallbackCommand="OnSchedulerBeforeExecuteCallbackCommand">
        
        <ClientSideEvents
           SelectionChanged="function(s,e) { OnSelectionChanged(s, e); }"
           BeginCallback="function(s,e) { OnBeginCallback(s, e); }"
           EndCallback="function(s,e) {OnEndCallback(s,e); }"
         />
        <Storage EnableReminders="False">
<Appointments ResourceSharing="true"><CustomFieldMappings>
<dxwschs:ASPxAppointmentCustomFieldMapping Member="Price" Name="Price"></dxwschs:ASPxAppointmentCustomFieldMapping>
<dxwschs:ASPxAppointmentCustomFieldMapping Member="ContactInfo" Name="ContactInfo"></dxwschs:ASPxAppointmentCustomFieldMapping>
</CustomFieldMappings>
</Appointments>
</Storage>

<Views>
             <DayView>
                 <TimeRulers><cc1:TimeRuler /></TimeRulers>
                 <DayViewStyles ScrollAreaHeight="300px" AllDayArea-Font-Size="10px" />
             </DayView>
             <WorkWeekView>
                 <TimeRulers><cc1:TimeRuler /></TimeRulers>
                 <WorkWeekViewStyles ScrollAreaHeight="300px" />
             </WorkWeekView>
             <WeekView>
               <WeekViewStyles>
                 <DateCellBody Height="200px" />                
               </WeekViewStyles>
             </WeekView>
             <MonthView>
               <MonthViewStyles>
                 <DateCellBody Height="100px" />                
               </MonthViewStyles>
             </MonthView>
             <TimelineView>
               <TimelineViewStyles>
                 <TimelineCellBody Height="500px" />                
               </TimelineViewStyles>
             </TimelineView>
         </Views>

    </dxwschs:ASPxScheduler>
   
    
    </td>
    <td width="150" valign="top">

      <dxwschs:ASPxDateNavigator runat="server" ID="ASPxDateNavigator1" MasterControlID="ASPxScheduler1" Width="160px">
            <Properties Rows="1" DayNameFormat="FirstLetter"  DayHeaderStyle-Font-Size ="10px" DayStyle-Font-Size="10px"  />
                       
        </dxwschs:ASPxDateNavigator>
    
    <br />

    <dxe:ASPxRadioButtonList ID="rbVisibility" runat="server" ValueType="System.Int32" SelectedIndex="2" RepeatDirection="Vertical" TextWrap="False" Width="100%" ItemSpacing="10px" EnableClientSideAPI="True">
						<Border BorderStyle="None" />
						<Items>
							<dxe:ListEditItem Text="Normal Display" Value="0" />
							<dxe:ListEditItem Text="Display By Date" Value="1" />
							<dxe:ListEditItem Text="Display By Technician" Value="2" />
						</Items>
						<Paddings Padding="0px" />
						<ClientSideEvents SelectedIndexChanged="function(s, e) {
							switch(s.savedSelectedIndex) {
								case 0:
									scheduler.SetGroupType(ASPxSchedulerGroupType.None);
									break;
								case 1:
									scheduler.SetGroupType(ASPxSchedulerGroupType.Date);
									break;
								case 2:
									scheduler.SetGroupType(ASPxSchedulerGroupType.Resource);
									break;
								}
									}" />
					</dxe:ASPxRadioButtonList>

    </td>
    </tr>
    
    </table>
    
 

  </form>
</body>
</html>

